n=input()
arr=input().split(' ')
maxa=-10000001
der=-1
for i in range(0,len(arr)):
    if int(arr[i])>maxa:
        maxa=int(arr[i])
        der=i
print(maxa,der)